function [ u ] = myQuadrature( x, n )
%MYQUADRATURE Summary of this function goes here
%   Detailed explanation goes here

y0 = [-1, 0];
y1 = [1, 0];

inp = linspace(y0(1), y1(1), n);

y = zeros(n, 2);

y(2:n-1, 1) = inp(2:n-1);

l = 2 / (n - 1);

yn = [0, 1];

u = 0;

for i = 1 : n-1
    
    ys = y(i, :);
    ye = y(i+1, :);
    
    v0 = evaluateQuadraturePoint(x, ys, yn);
    v1 = evaluateQuadraturePoint(x, ye, yn);
    
    u = u + (v0 + v1) * l / 2;
    
end

end

